package com.lngsyz.file.enumeration;

/**
 * @author Administrator
 *
 */
public enum DataType {
	TEXT("字符串", "0"),
	IMG("图片", "1"),
	QR("二维码", "2");

	private String name;
	private String key;

	private DataType(String name, String key) {
		this.name = name;
		this.key = key;
	}

	public static String getNameByKey(String key) {
		for (DataType state : DataType.values()) {
			if (state.getKey().equalsIgnoreCase(key)) {
				return state.getName();
			}
		}
		return "";
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

}
